package com.eascs.web.o2o.web.controller;

import com.eascs.app.dao.PageResult;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.site.page.PaginationInfo;
import com.eascs.site.view.ViewContext;
import com.eascs.tag.MenuTag;
import com.eascs.web.o2o.web.common.BaseMasterViewController;
import com.eascs.web.o2o.web.form.BankLoanProgressForm;
import com.eascs.web.o2o.web.service.BankLoanProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 银行申报进度跟进表
 */
@Controller
@RequestMapping("/bankloan/progress")
public class BankLoanProgressFollowController extends BaseMasterViewController {
	@Override
	public void preHandle() {
		super.preHandle();
		ViewContext.put(MenuTag.CURRENT_MENU_CODE, "report");
	}
	
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	BankLoanProgressService bankLoanProgressService;

	@RequestMapping("/page")
	public String page(BankLoanProgressForm form) {
		ViewContext.put(MenuTag.CURRENT_MENU_CODE, "bankLoanProgress");
		String o2ourl   = "/bankloan/progress/data";
		String titles[] = {"省区", "平台编码", "借款人", "金额(万元)", "分配时间", "提报时间", "申报状态", "备注", "跟进人"};


		form.setPageSize(Integer.MAX_VALUE);
		PageResult<Object[]> pageResult    = bankLoanProgressService.pageBankLoanProgress(form);
		PaginationInfo       o2oPagingInfo = new PaginationInfo(pageResult, titles, o2ourl);
		o2oPagingInfo.setBuildPagingNavigation(true);
		o2oPagingInfo.setFirstRenderColumnIndex(0);

		ViewContext.put("oaurl", o2ourl);
		ViewContext.put("vo", form);
		ViewContext.put("paginationInfo", o2oPagingInfo);
		return "bankloanProgress/bankLoanProgressList";
	}


}
